package com.test.clyq.serviceImpl;

import java.util.List;

import com.test.clyq.dao.QuestionCategoryDao;
import com.test.clyq.entity.QuestionCategory;
import com.test.clyq.entity.Users;
import com.test.clyq.service.QuestionCategoryService;
import com.test.service.impl.BaseManager;
import com.test.util.Pagination;

/**
 * QuestionCategoryServiceImpl. <br>
 * 问题类别管理.
 * <p>
 * Copyright: Copyright (c) 2010-3-17 下午04:30:46
 * <p>
 * Company: 北京宽连十方数字技术有限公司
 * <p>
 * Author: liuxl@c-platform.com
 * <p>
 * Version: 1.0
 * <p>
 */
public class QuestionCategoryServiceImpl extends BaseManager implements QuestionCategoryService {

	private QuestionCategoryDao downFileDao;

	/**
	 * 添加问题类别
	 * 
	 * @param file
	 * @param user
	 */
	public void addQuestionCategory(QuestionCategory file, Users user) {
		downFileDao.addQuestionCategory(file, user);
	}

	/**
	 * 删除问题类别
	 * 
	 * @param id
	 * @param user
	 */
	public boolean deleteQuestionCategory(Long id, Users user) {
		return downFileDao.deleteQuestionCategory(id, user);
	}

	public QuestionCategoryDao getDownFileDao() {
		return downFileDao;
	}

	/**
	 * 获取一个问题类别
	 * 
	 * @param id
	 * @return
	 */
	public QuestionCategory getOneQuestionCategory(Long id) {
		return downFileDao.getOneQuestionCategory(id);
	}

	/**
	 * 通过分页获取问题类别
	 * 
	 * @param pagination
	 * @param categoryId
	 * @return
	 */
	public List<QuestionCategory> getQuestionCategoryByPage(Pagination pagination) {
		return downFileDao.getQuestionCategoryByPage(pagination);
	}

	/**
	 * 获取所有问题类别
	 * 
	 * @param categoryId
	 *            所属栏目id
	 * @return
	 */
	public List<QuestionCategory> getQuestionCategorys() {
		return downFileDao.getQuestionCategorys();
	}

	@Override
	public List<QuestionCategory> getQuestionCategorys(Integer website) {
		return downFileDao.getQuestionCategorys(website);
	}

	public void setDownFileDao(QuestionCategoryDao downFileDao) {
		this.downFileDao = downFileDao;
	}

	/**
	 * 修改问题类别
	 * 
	 * @param id
	 * @param user
	 */
	public void updateQuestionCategory(QuestionCategory file, Users user) {
		downFileDao.updateQuestionCategory(file, user);
	}
}
